import { reactive } from "vue";
import type { FormRules } from "element-plus";

/** 自定义表单规则校验 */
export const formRules = reactive(<FormRules>{
    code: [{ required: true, message: "编码为必填项", trigger: "blur" }],
    name: [{ required: true, message: "名称为必填项", trigger: "blur" }],
    layer: [{ required: true, message: "总排数为必填项", trigger: "blur" }],
    row: [{ required: true, message: "总列数为必填项", trigger: "blur" }],
    sort: [{ required: true, message: "排序为必填项", trigger: "blur" }],
    status: [{ required: true, message: "状态为必填项", trigger: "blur" }],
    warehouseid: [{ required: true, message: "所属仓库为必填项", trigger: "change" }],
});


export const locationRules = reactive(<FormRules>{
    code: [{ required: true, message: "编码为必填项", trigger: "blur" }],
    name: [{ required: true, message: "名称为必填项", trigger: "blur" }],
    layer: [{ required: true, message: "货架总排数为必填项", trigger: "blur" }],
    row: [{ required: true, message: "货架总列数为必填项", trigger: "blur" }],
    length: [{ required: true, message: "货位长度为必填项", trigger: "blur" }],
    width: [{ required: true, message: "货位宽度为必填项", trigger: "blur" }],
    height: [{ required: true, message: "货位高度为必填项", trigger: "blur" }],
    // prefix: [{ required: true, message: "货位编码前缀为必填项", trigger: "blur" }],
    codingRules: [{ required: true, message: "货位编码规则为必填项", trigger: "blur" }],
    attribute: [{ required: true, message: "货位属性为必填项", trigger: "change" }],
});
